Refactor/metamo action - #8
Open
fevenissayas wants to merge 12 commits into
Open
Conversation
Member
|
@fevenissayas have you seen how it maps to other parts of the file as well since you touched the files in the |
Contributor
Author
@Nahom32 Yes, i changed it because the action definitions were duplicated across different parts of the system and created multiple sources of truth. I moved them into core so every component uses the same definitions. I also checked that the dependent modules still mapped correctly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a major refactor and expansion of the action modeling and candidate generation pipeline, centralizing action semantics and profiles, improving action risk handling, and simplifying/focusing the LLM client logic. It also removes legacy fallback code and consolidates action schema logic into a new core module. The changes are grouped into three main themes:
1. Action Modeling Refactor and Centralization
core/actions.pyto defineActionSpec,ModeProfile, andActionProfiledataclasses, along with canonical action definitions, aliases, and motivational profiles. This centralizes all action semantics, planning/execution instructions, and motivational mappings in a single location for consistent use across the codebase.llm/action_schema.pyfile, moving all action schema logic tocore/actions.py.2. Candidate Generation and Risk Handling Improvements
get_action_risks_from_text), and candidate actions are constructed using the newbuild_candidate_actionsfunction (frommagus.candidates), which leverages the centralized action profiles and risk overrides. [1] [2] [3] [4]llm/client.py, enforcing a single, consistent LLM-driven pipeline.3. Codebase Simplification and Consistency
ActionandStimulusdataclasses incore/state.pyto remove unused fields (e.g.,delta_gfromAction), and clarified type annotations. [1] [2] [3]llm/conversation.pyfor improved reliability and retry handling, and to use the new action schema interface fromcore/actions.py. [1] [2] [3]These changes collectively make action handling more robust, maintainable, and extensible, and pave the way for more advanced motivational reasoning and action selection.